class Resource < ActiveRecord::Base
  belongs_to :section, :class_name => "Section", :foreign_key => "col_id"
  has_many   :res_tag, :class_name =>"ResTag", :foreign_key=>"res_id",
    :dependent=> :delete_all
  has_many  :tags, :through => :res_tag
  has_many   :user_comment, :class_name =>"UserComment", :foreign_key=>"res_id",
    :dependent=> :delete_all
  has_many   :user_collect, :class_name =>"UserCollect", :foreign_key=>"res_id",
    :dependent=> :delete_all
end
